package com.ilovepostcard.controller.server;

import java.io.File;

/**
 * Interfaces of "手机客户端接口.docx"
 */
public interface IServer {
    
    PostcardResult login(String uname, String pwd);
    
    PostcardResult register(String uname, String pwd, String nickname);
    
    public static final int OPEN_TYPE_SINA = 1;
    public static final int OPEN_TYPE_QQ = 2;
    PostcardResult userLoginFromOpen(String uname, String nickname, int type);
    
    PostcardResult getUserInfo(String uname, long uid);
    
    /** pi: page index(start from 1), pc: page count */
    PostcardResult getRecommendPostcard(long uid, int pi, int pc); 
    
    PostcardResult getFriendPostcard(long uid, int pi, int pc);
    
    PostcardResult getMyPostcard(long uid, int pi, int pc);
    
    PostcardResult searchPostcard(String keyword, int pi, int pc);
    
    PostcardResult updateUserInfo(long uid, int sex, String birthday, String province, String city, String introduction, String nickname);
    
    PostcardResult getUploadSKey();
    
    public static final int FILE_TYPE_HEAD_IMAGE = 1;
    public static final int FILE_TYPE_POSTCARD = 2;
    PostcardResult uploadFile(int type, String fileName, String skey, long uid, int x, int y, int w,int h, int r, File source);
    
    PostcardResult canModifyNickname(long uid);
    
    PostcardResult listCity();
    
    PostcardResult createPostcard(long uid, String location,
            String tofriendswords, String story, boolean isshowwords,
            double latitude, double longitude, String skey, int viewPermission,
            int locationPermission, String tags);
    
    PostcardResult deletePostcard(long pid, long uid);
    
    PostcardResult postProposal(long uid, String body);
    
    PostcardResult checkNew(String ver, String channel);
    
    public static final int ATTENTION_TYPE_FOLLOW = 1;
    public static final int ATTENTION_TYPE_CANCEL_FOLLOW = 2;
    PostcardResult attention(long uidMy, long uidOther, int type);
    
    PostcardResult checkAttention(long uidMy, long uidOther);
    
    public static final int ATTENTION_FOLLOWING = 1;
    public static final int ATTENTION_FOLLOWED = 2;
    /** pi: page index(start from 1), pc: page count */
    PostcardResult getAttentionList(long uid, int type, int pi, int pc);
    
    PostcardResult getPostcardInfo(long pid);
    
    PostcardResult getUserActiveTime(long uid);
    
    PostcardResult likePostcard(long uid, long pid);
    
    PostcardResult newPostcardComment(long uid, long pid, String body);
    
    PostcardResult getPostcardComments(long pid, int pi, int pc);
    
    PostcardResult searchUser(String k, int pi, int pc);
    
    PostcardResult getNewMessageCount(long uid);
    
    PostcardResult deleteMessage(long uid, long mid);
    
    PostcardResult listMessage(long uid, int pi, int pc);
    
    PostcardResult getUserHeadImg(long uid);
    
    PostcardResult listAddress(long uid, int pi, int pc);
    
    PostcardResult newAddress(long uid, String name, String telephone, String province, String city, String address, String zipcode);
    
    public static final String ORDER_TYPE_SINGLE = "single";
    public static final String ORDER_TYPE_SUIT = "suit";
    PostcardResult newOrder(String type, long uid, long[] pids, String sendword, long[] aids);
    
    PostcardResult listOrder(long uid, int pi, int pc);
    
    PostcardResult getOrderInfo(long oid);
    
    PostcardResult checkLike(long uid, long pid);
    
    public static final int TEXT_CONFIG_TYPE_SHARE = 1;
    public static final int TEXT_CONFIG_TYPE_MAIL_SHARE = 2;
    public static final int TEXT_CONFIG_TYPE_INVITE_SMS = 3;
    public static final int TEXT_CONFIG_TYPE_INVITE_MAIL = 4;
    PostcardResult getShareTextConfig(int type, long uid, long pid);
    
    PostcardResult getLastPostcardComment(long uid, long pid);
    
    PostcardResult GetBuycartUrl(long uid);
}
